package com.kangkang.leetcode30;

public class Test389 {
    public static char findTheDifference(String s, String t) {
        int[] index = new int[26];
        for (int i = 0; i < 26; i++) {
            index[i] = 0;
        }
        for (int i = 0; i < s.length(); i++) {
            index[s.charAt(i) - 97]++;
        }

        for (int i = 0; i < t.length(); i++) {
            index[t.charAt(i) - 97]--;
        }
        for (int i = 0; i < index.length; i++) {
            if (index[i] == -1) return (char) (i + 97);
        }
        return ' ';
    }

    public static void main(String[] args) {
//        System.out.println(findTheDifference("dakhso","daksrheo"));
        // System.out.println('a'^'b'^'u');

        String regex = "\\[[0-9]+\\|[A-Z]+\\]";
        System.out.println("HG[3|B[2|CA]]F".matches(regex));
        //97:1100001
        //98:1100010
        //  :0000011
    }
}
